#pragma once
#ifdef USE_JSENGINE
#include <QJSEngine>
#include <QJSValue>
typedef QJSEngine JSEngine;
typedef QJSValue  JSValue;
#else
#include <QScriptEngine>
#include <QScriptValue>
#include <QScriptEngineDebugger>

typedef QScriptEngine JSEngine;
typedef QScriptValue  JSValue;
#endif
#include "CreateOccObject.h"
#include "qoccalgo.h"
#include "OperateOccObject.h"
#include "ScriptBase.h"
class MeshData;
class UITemplate;
class JSParse : public ScriptBase
{
public:
	JSParse(ZMString strJSFileName="");
	~JSParse();


	bool IsVaid() const;

	virtual ZMVector<SharedPointer<UIDataBase>> GetParam()
	{
		return ZMVector<SharedPointer<UIDataBase>>();
	}

	virtual void SetParamCore(const ZMVector<SharedPointer<UIDataBase>>& vParam);

protected:
	ZMVector<suDrawMesh> GetMeshData(const ZMString& strMeshName = "");
private:
	ZMString m_strJSFileName;
	JSEngine m_mainEngine;
	static ZMString m_strFuncCreateAndUpdateObject;

	CreateOccObject m_occCreateObj;
	QOccAlgo m_occAlgo;
	OperateOccObject m_occOperate;

	QScriptEngineDebugger m_Debugger;
	QMainWindow *m_debugWindow;
};

